package gameElements.shapes;

import gameElements.Cell;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Alexandra
 */
public class Field extends Shape {

    public List<ArrayList<Cell>> _fieldMatrix= new ArrayList<ArrayList<Cell>>();;
   
    public void addCell (int x, int y, Cell c){
        _fieldMatrix.get(x).set(y, c);
    }
    public List<ArrayList<Cell>> getFieldMatrix() {
        return _fieldMatrix;
    }

    public void setFieldMatrix(List<ArrayList<Cell>> _fieldMatrix) {
        this._fieldMatrix = _fieldMatrix;
    }

    public int getDimensionx() {
        return _dimensionx;
    }

    public void setDimensionx(int _dimension) {
        this._dimensionx = _dimension;
         //_fieldMatrix = new ArrayList<ArrayList<Cell>>();
    }
     public int getDimensiony() {
        return _dimensiony;
    }

    public void setDimensiony(int _dimension) {
        this._dimensiony = _dimension;
         //_fieldMatrix = new ArrayList<ArrayList<Cell>>();
    }
    public int _dimensionx;
    public int _dimensiony;

    public Field() {
        _dimensionx = constants.Constants.getDIMENSIONx();
        _dimensiony = constants.Constants.getDIMENSIONy();
        _fieldMatrix = new ArrayList<ArrayList<Cell>>();
       
        for (int y = 0; y < _dimensionx; y++) {
             ArrayList <Cell> test = new ArrayList<Cell>();
            for (int i = 0; i < _dimensiony; i++) {
              Cell c = new Cell(i * 10 + 10, y * 10 + 10);
              test.add(c);
                
            }
            _fieldMatrix.add(test);
        }
        
    }
    public Field(int d,int f) {
        _dimensionx = d;
        _dimensiony = f;
        // _fieldMatrix = new ArrayList<ArrayList<Cell>>();
    }
}
